{layout name="./base/base_back"}
	<link rel="stylesheet" type="text/css" href="/front/css/caravanOrderList.css"/>
	<script src="/front/js/jquery.js"></script>
	<script src="/front/js/index.js"></script>
		<!--房车订单开始-->
		<div id="caravan-order-list-box">
			<div id="caravan-order-list">
				{include file="./navleft"}
				<div class="caravan-order-list-right">
					<div class="caravan-order-list-tit">房车订单</div>
					<ul class="caravan-order-list-table">
						<li><a href="/order/allorders">全部</a><span style="padding-left:2px;font-weight:700;"></span></li>
						<li><a href="/order/unpayorder">未支付订单</a><span style="padding-left:2px;font-weight:700;"></span></li>
						<li class="active-li"><a href="/order/payedorder">订单支付</a><span style="padding-left:2px;font-weight:700;">({$count_payedlist})</span></li>
						<li><a href="/order/refundorder">订单退款</a><span style="padding-left:2px;font-weight:700;"></span></li>
						<li><a href="/order/celorder">已取消订单</a><span style="padding-left:2px;font-weight:700;"></span></li>
						<li class="basis-ordernum-find"><a href="/order/doneorder">订单完成</a><span style="padding-left:2px;font-weight:700;"></span></li>
					</ul>
					<!--全部的开始-->
					
					<div class="caravan-order-list-group" style="display: block;">
					{volist name='payedlist' id='vo'} 
						<div class="caravan-order-group-tit">
							<span>订单编号：<i>{$vo.number}</i></span>
							<span>下单时间：<i>{$vo.created_at}</i></span>
							<span class="caravan-order-group-state">[{$vo.status_text}]</span>
							
							<span></span>
							<span class="caravan-order-group-service">营地客服：<img src="/front/img/lx.png" alt="" /></span>
						</div>
						<div class="caravan-order-group-cont">
							<ul>
								<li class="caravan-img">
								{if !empty($vo['caravan']['caravancover'][0])}
								<img src={$vo.caravan.caravancover[0]} alt="" />
								{/if}
								</li>
								<li class="caravan-order-li-1">
									<p>房车名称
										<a href={:url('/reserve/caravandetail?id='.$vo->caravan->id.'&sdate'.$vo->take_car_date.'&edate'.$vo->leave_car_date.'',"",'','www')}>：
											<i>{$vo.caravan.name}</i>
										</a>
									</p>
									<p>{$vo.caravan.carcates.name}</p>
									<p class="caravan-order-camp">营地服务机构名称:<a href="#">（<i>{$vo.camp.name}</i>）</a></p>
									<p>入住：<i>{$vo.take_car_date}</i></p>
									<p>离开：<i>{$vo.leave_car_date}</i></p>
								</li>
								<li class="caravan-order-li-2">
									<p class="need-pay" style="display: none;">需支付</p>
									<p class="need-pay">在线支付</p>
									{if $vo.travel_coin !== 0}
									<p>旅行币 {$vo.travel_coin}</p>
									{/if}
									{if $vo.total_money !== 0}
									<p>现金 <i>¥</i>{$vo.total_money}</p>
									{/if}
								</li>
								<li class="caravan-order-li-3">
									<!-- <img src="/front/img/appcar.png" alt="" />
									<p>验证编码：1212151</p> -->
								</li>
								<li class="caravan-order-li-4">
									{if $vo.stage == 0 && $vo.status == 1}
										<p><a href="/order/payorder?order_id={$vo.number}" target="_blank">马上支付</a></p>
									{/if}
									{if $vo.stage == 1 && $vo.status == 0}
										<p><a href="/order/payorder?order_id={$vo.number}" target="_blank">继续支付</a></p>
									{/if}
									<p><a href="/order/orderdetail?id={$vo.id}">查看详情</a></p>
									{if !(($vo.stage == 4) || ($vo.stage == 3) || ($vo.stage == 2))}
										<p><a id="cel" onclick="cel({$vo.number})">取消订单</a></p>
									{/if}
								</li>
							</ul>
						</div>
						<script type="text/javascript">
							function getLocalTime(t) {
								h=Math.floor(t/60/60%24);
							    m=Math.floor(t/60%60);
							    s=Math.floor(t%60);
								return h+'小时'+m+'分'+s+'秒';
							}
							$('#{$vo.id}').each(function(){
								var btn = $(this);
								var count = btn.text();
						    	var time = parseInt(count);
							    var resend = setInterval(function(){
							        count--;
							        if (count >=-1){
							            btn.html(getLocalTime(time--));
							        }else {
							        	btn.html(0);
							        	$('#{$vo.id}').each(function(){
											if($(this).text()<=0){
												$(this).parent('tr').hide();
								            	var data = $(this).siblings('input').val();
								            	$.ajax({
								            		type:"get",
								            		url:"/wishs/cancelorder",
								            		data:{id:data},
								            	});
								            }
										})
							            clearInterval(resend);
							        }
							    }, 1000);
							})
						</script>
					{/volist}

					<!--已支付取消订单提示框开始-->
						<div id="shsy-coin-bounced-box4" class="shsy-coin-bounced-box" style="display:none;">
							<div class="shsy-coin-bounced-bg"></div>
							<div id="shsy-coin-bounced">
								<div class="shsy-bounced-info">
									<div class="shsy-prompt-title">
										<p class="shsy-prompt">温馨提示</p>
										<p class="shsy-close">关闭</p>
									</div>
									<div class="shsy-prompt-cont">
										<dt>取消订单注意事项：</dt>
										<dd>1. 如果您未支付取消订单,无任何惩罚措施。</dd>
										<dd>2. 如果您已支付并且入住前7天外取消订单,不扣除任何费用。</dd>
										<dd>3. 如果您已支付并且入住前7天内取消订单,将扣除本订单旅行币的50%。</dd>
										<dd>确定要取消订单吗？</dd>
									</div>
									<div class="shsy-prompt-over">
										<a id="true3" href="">确定</a>
									</div>
								</div>
							</div>
						</div>
					<!--已支付取消订单提示框结束-->
					<!-- 触发弹出框开始-->
						<script type="text/javascript">
							function cel(id){
								$('#true3').attr('href','/order/cancelorder?id='+id);
								$('#shsy-coin-bounced-box4').show();
							}
							$(function(){
								$(".shsy-close").click(function(){
									$('#shsy-coin-bounced-box4').hide();
								})
							})
						</script>
					<!-- 触发弹出框结束	 -->
						
					</div>
					
					<!--全部的结束-->
					{$payedlist->render()}
					<dl>
						<dt>温馨提示</dt>
						<dd>1. 入住前7天外取消订单，不扣除任何费用。</dd>
						<dd>2. 入住前7天内取消订单，将扣除本订单订金（旅行币或现金）的50%。</dd>
					</dl>
				</div>
			</div>
		</div>
		<!--房车订单结束-->
